#ifndef __PARSER__
#define __PARSER__

#include "ParserTreeNode.h"
#include "Lex.h"
#include <fstream>
#include <cstdlib>

class Parser
{
public:
	Parser();
	~Parser();

	// Parse a list(would be recursive) from an input file and produce a binary tree(or if error happens, output error to ofs)
	ParserTree* parseList();

private:
	Lex lex;
public:
	// read nextoken, return true if reaching file end
	void nextToken();
	bool isFileEnd();
};

#endif
